package com.xzy.demo.controller;

import com.xzy.mybatis.pojo.User;
import com.xzy.mybatis.service.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {

    @Autowired private UserMapper userMapper;
    @RequestMapping("/userList")
    public String userList(Model model){
        List<User> userList = userMapper.getUserList();
        model.addAttribute("userList",userList);
        return "user/list";
    }

}
